package mars.ns.core

class Edge(from:Node,to:Node,linkType:LinkType) extends Link(to,linkType) {
	/**
	 * creates a uniqueString to use in hashmaps with string
	 */
    def uniqueString = from.id+","+to.id+","+linkType.toString()
    def getLinkedFrom(): Node = from
    
    // a link is unique by linkedFrom, linkedTo and linkType
    override def canEqual(other: Any): Boolean = other match {
        case null => false
        case o : Edge => this.getLinkedTo.canEqual(o.getLinkedTo) && this.getLinkedFrom().canEqual(o.getLinkedFrom()) && this.linkType.canEqual(o.getType)
        case _ => false
    }
}